package com.ty.cloudpicture.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ty.cloudpicture.api.aliyun.model.CreateOutPaintingTaskResponse;
import com.ty.cloudpicture.model.dto.picture.*;
import com.ty.cloudpicture.model.entity.Picture;
import com.baomidou.mybatisplus.extension.service.IService;
import com.ty.cloudpicture.model.entity.User;
import com.ty.cloudpicture.model.vo.PictureVO;
import org.springframework.scheduling.annotation.Async;

/**
* @author ong char
* @description 针对表【picture(图片)】的数据库操作Service
* @createDate 2025-02-12 21:26:29
*/
public interface PictureService extends IService<Picture> {
    PictureVO uploadPicture(Object inputSource, PictureUploadRequest pictureUploadRequest, User loginUser);

    QueryWrapper<Picture> getQueryWrapper(PictureQueryRequest pictureQueryRequest);

    PictureVO getPictureVO(Picture picture);

    Page<PictureVO> getPictureVOPage(Page<Picture> picturePage);

    void validPicture(Picture picture);

    void doPictureReview(PictureReviewRequest pictureReviewRequest, User loginUser);

    void fillReviewParams(Picture picture, User loginUser);

    long uploadPictureByBatch(PictureUploadByBatchRequest pictureUploadByBatchRequest, User loginUser);

//    void checkPictureAuth(User loginUser, Picture picture);

    boolean deletePicture(Long id, User loginUser);
    boolean editPicture(PictureEditRequest pictureEditeRequest, User loginUser);

    @Async
    // 异步执行清除图片文件的方法
    void clearPictureFile(Picture oldPicture);

    void editPictureByBatch(PictureEditByBatchRequest pictureEditByBatchRequest, User loginUser);

    CreateOutPaintingTaskResponse createPictureOutPaintingTask(CreatePictureOutPaintingTaskRequest createPictureOutPaintingTaskRequest, User loginUser);
}
